/**
* 作者 ：食草狂魔
*
* 日期 ：2017/11/14
*
* 描述 ：首页
*/
<template>
  <el-container class="is-vertical">
    <HeaderBar :menuState="menuState"></HeaderBar>
    <el-main>
      <!--<Welcome></Welcome>-->
      <MenuCount :menuCountData="menuCountData" style="margin-top: 20px;"></MenuCount>
      <ModuleBar :title="moduleBarTitle" style="margin-top: 20px;"></ModuleBar>
      <QuickEntry style="margin-top: 20px;"></QuickEntry>
    </el-main>
  </el-container>
</template>
<script>
  import authAPIs from '../../api/authAPIs'
  import HeaderBar from '../../components/header/Header.vue'
  import Welcome from './components/welcome/Welcome.vue'
  import MenuCount from './components/menuCount/MenuCount.vue'
  import ModuleBar from '../../components/modulebar/ModuleBar.vue'
  import QuickEntry from './components/quickEntry/QuickEntry.vue'
  export default {
    name: 'index',
    components: {
      HeaderBar,
      Welcome,
      MenuCount,
      ModuleBar,
      QuickEntry
    },
    data () {
      let vm = this;
      return {
        menuState: 'home',
        moduleBarTitle: '便捷入口',
        menuCountData: {
          basisDirTypeNum: 0,
          themeDirTypeNum: 0,
          departmentDirTypeNum: 0
        }
      }
    },
    mounted () {
      let vm = this
//      console.log(localStorage)
      authAPIs.home({
        token: localStorage.token?localStorage.token:""
      }).then(({ data }) => {
       console.log(data)
        if(data.code == 10000){
          vm.menuCountData = data.data
        }
      })
    },
    methods: {

    }
  }
</script>

<style>
</style>
